#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'bam'
exit 1
}

while getopts  ":p:f:i:" opt; do
    case  $opt  in
        p) out_prefix=$OPTARG;;
        f) suffix=$OPTARG;;
        i) interval=$OPTARG;;
        *) info;;
    esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi

. $var

test -n "$interval" && interval="-l $interval"

~/../fengbo.zeng/local/bin/samtools mpileup \
-uv \
-B -Q 20 -C 50 -q 20 -d 20000 \
-f $ref_genome \
-t DP,AD,ADF,ADR,SP \
$interval \
$1 > $out_prefix.mpileup.vcf

. $cmd_done
